#define DEBUG
#include <cstdio>

using namespace std;

const int maxn=300;

int max(int a, int b) {
  return a>b ? a : b;
}

int main() {
#ifdef DEBUG
  freopen("3235.in", "r", stdin);
  freopen("3235.out", "w", stdout);
#endif

  static char map[maxn+1][maxn+1];
  static int sum[maxn+1][maxn+1], f[maxn+1][maxn+1][maxn+1], g[maxn+1][maxn+1];
  int n;
  scanf("%d ", &n);
  for (int i=1; i<=n; i++) {
    for (int j=1; j<=n; j++) {
      map[i][j] = getchar();
      if (map[i][j]=='*') {
	sum[i][j] = sum[i][j-1]+1;
      } else {
	sum[i][j] = sum[i][j-1];
      }
    }
    getchar();
  }

  for (int i=1; i<=n; i++) {
    for (int j=1; j<=n; j++) {
      f[0][i][j] = -1;
    }
  }
  for (int i=1; i<=n; i++) {
    for (int j=1; j<=n; j++) {
      for (int k=j; k<=n; k++) {
	if (map[i][j]=='*' || map[i][k]=='*') {
	  f[i][j][k] = -1;
	} else {
	  if (f[i-1][j][k]>=0) {
	    f[i][j][k] = f[i-1][j][k]+1;
	  } else if (sum[i][j]-sum[i][k-1]==0) {
	    f[i][j][k] = 0;
	  } else {
	    f[i][j][k] = -1;
	  }
	}
      }
    }
  }
  for (int i=1; i<=n; i++) {
    for (int j=1; j<=n; j++) {
      for (int k=j; k<=n; k++) {
	if (f[i][j][k]>0 && k>j+1) {
	  f[i][j][k] = f[i][j][k]*(k-j-1);
	} else {
	  f[i][j][k] = -1;
	}
	f[i][j][k] = max(f[i][j][k], f[i][j][k-1]);
      }
    }
    for (int k=n; k>0; k--) {
      for (int j=k-1; j>0; j--) {
	f[i][j][k] = max(f[i][j][k], f[i][j+1][k]);
      }
    }
  }

  int ans=-1;
  for (int i=1; i<=n; i++) {
    for (int j=1; j<=n; j++) {
      g[i][j] = -1;
    }
  }
  for (int i=n; i>0; i--) {
    for (int j=1; j<=n; j++) {
      for (int k=j; k<=n; k++) {
	if (i<n && k>j+1 && sum[i][k]-sum[i][j-1]==0 && g[j][k]>0 && f[i-1][j][k]>0) {
	  ans = max(ans, g[j][k]*(k-j-1)*f[i-1][j][k]);
	}
	if (map[i][j]=='*' || map[i][k]=='*') {
	  g[j][k] = -1;
	} else {
	  if (g[j][k]>=0) {
	    g[j][k] = g[j][k]+1;
	  } else if (sum[i][j]-sum[i][k-1]==0) {
	    g[j][k] = 0;
	  } else {
	    g[j][k] = -1;
	  }
	}
      }
    }
  }

  printf("%d", ans);

  fclose(stdin);
  fclose(stdout);
  return 0;
}
